/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package za.ac.cput.assignment2.smallbusiness;

import java.util.Locale;
import za.ac.cput.assignment2.LoanInterest;

/**
 *
 * @author yandiswa
 */
public class SmallBusiness implements LoanInterest {
    
    private String name;
    private String regNum;
    private double loanAmount;
    
    public SmallBusiness(){
    }
    
    public SmallBusiness(String nm,String reg,double loan){
        
        name = nm;
        regNum = reg;
        loanAmount = loan;      
    }
    
    

    @Override
    public double interest() {
         
        return getLoanAmount() + (getLoanAmount() *0.15);
    }

    /**
     * @return the name
     */
    public String getName() {
        return name;
    }

    /**
     * @param name the name to set
     */
    public void setName(String name) {
        this.name = name;
    }

    /**
     * @return the regNum
     */
    public String getRegNum() {
        return regNum;
    }

    /**
     * @param regNum the regNum to set
     */
    public void setRegNum(String regNum) {
        this.regNum = regNum;
    }

    /**
     * @return the loanAmount
     */
    public double getLoanAmount() {
        return loanAmount;
    }

    /**
     * @param loanAmount the loanAmount to set
     */
    public void setLoanAmount(double loanAmount) {
        this.loanAmount = loanAmount;
    }
    
    public String toString(){
        String businessDetails;
        return businessDetails = String.format(" Business Name is : %s\n Business RegNo is: %s\nloan before interest%.2f\nloan after interest is: %.2f",getName(),getRegNum(),getLoanAmount(),interest());
    }
    
    
    
}
